package com.xiaocg.factory;

public class SimpleCoffeeFactory {

    public static Coffee createCoffee(String type){
        Coffee coffee = null;
        if ("americano".equals(type)){
            coffee = new AmericanoCoffee();
        }else if ("latte".equals(type)){
            coffee = new AmericanoCoffee();
        }else {
            throw new RuntimeException("没有对应的coffee");
        }
        return coffee;
    }
}
